package dwz.cms.article.util.ftp;

import java.io.File;
import java.util.Vector;


/** 
* Created by Eclipse
* @author : Yating
* @version:2017年5月9日 上午9:02:52 
* 类说明 
*/
public class EstimateThread extends Thread{
	private Vector<File> files;
	private String host;
	private int port;
	private String userName;
	private String password;
	private String initPath;
	private FtpError ftperror;
	public EstimateThread() {
		super();
	}
	public EstimateThread(Vector<File> files, String host, int port,
			String userName, String password, String initPath) {
		super();
		this.files = files;
		this.host = host;
		this.port = port;
		this.userName = userName;
		this.password = password;
		this.initPath = initPath;
	}
	public Vector<File> getFiles() {
		return files;
	}
	public void setFiles(Vector<File> files) {
		this.files = files;
	}
	public String getHost() {
		return host;
	}
	public void setHost(String host) {
		this.host = host;
	}
	public int getPort() {
		return port;
	}
	public void setPort(int port) {
		this.port = port;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getInitPath() {
		return initPath;
	}
	public void setInitPath(String initPath) {
		this.initPath = initPath;
	}
	public FtpError getFtperror() {
		return ftperror;
	}
	public void setFtperror(FtpError ftperror) {
		this.ftperror = ftperror;
	}
	public void run(){
		FTPUtils ftp=new FTPUtils();
		ftp.setInitPath(initPath);
		String mess="";
		if(ftperror!=null){
			try{
				ftp.getConnection(host, port, userName, password);
				mess=ftp.isSameFiles(files);
				ftperror.getHashtable().put(host, mess);
			}catch(Exception e){
				e.printStackTrace();
				ftperror.getHashtable().put(host, mess);
			}
		}
	}
}